import { createStore } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'
import cart from './modules/cart.js'
// 导入vuex模块
import user from './modules/user'
import category from './modules/category'
export default createStore({
  namespaced: true,
  state: {
  },
  getters: {
  },
  mutations: {
  },
  actions: {
  },
  modules: {
    user, category, cart
  },
  plugins: [
    createPersistedstate({
      // 配置项看插件本身
      key: 'rabbit', // localstorage(key,value)
      paths: ['user', 'cart'] // 是一个数组，把需要自动被持久化的模块的名字
    })
  ]
})
